/*
 * @Description: 月计划调整数据模型
 * @Author: wind-lc
 * @version: 1.0
 * @Date: 2023-06-07 15:16:04
 * @LastEditTime: 2023-06-21 15:51:18
 * @FilePath: \cscec-pms-admin\src\views\construction\monthPlanAdjust\model.js
 */

import SelectOfMonthly from '@/components/Select/SelectOfMonthly'
// 状态
const auditStatus = [
  {
    value: 0,
    label: '待提交'
  },
  {
    value: 1,
    label: '审核中'
  },
  {
    value: 2,
    label: '审核通过'
  },
  {
    value: 3,
    label: '审核不通过'
  }
]
// 月计划调整列表搜索项
const searchOption = [
  {
    name: '项目名称',
    value: 'projectName',
    type: 'input',
  },
  {
    name: '状态',
    value: 'auditStatus',
    type: 'select',
    data: auditStatus
  },
  {
    name: '所属月度',
    valueKey: 'belongMonth',
    type: SelectOfMonthly,
    attrs: {
      allowClear: false
    }
  }
]
// 月计划调整列表表头
const columns = [
  {
    title: '序号',
    width: 80,
    align: 'center',
    customRender: (text, record, index) => {
      return index + 1
    }
  },
  {
    title: '项目名称',
    width: 160,
    dataIndex: 'projectName',
    ellipsis: true
  },
  {
    title: '所属月度',
    width: 150,
    dataIndex: 'belongMonth',
  },
  {
    title: '调整一级节点个数',
    width: 150,
    dataIndex: 'firstAdjustNum',
  },
  {
    title: '调整二级节点个数',
    width: 150,
    dataIndex: 'secondAdjustNum',
  },
  {
    title: '调整三级节点个数',
    width: 150,
    dataIndex: 'threeAdjustNum',
  },
  {
    title: '创建时间',
    width: 120,
    dataIndex: 'createTime',
  },
  {
    title: '申请人 ',
    width: 130,
    dataIndex: 'creatorName',
  },
  {
    title: '状态 ',
    width: 130,
    dataIndex: 'auditStatus',
    customRender: (text) => {
      return auditStatus.find(el => el.value == text)?.label
    }
  },
  {
    title: '操作',
    dataIndex: 'operation',
    width: 200,
    align: 'center',
    scopedSlots: { customRender: 'operation' }
  }
]
// 基本信息表单
const formOption = [
  {
    label: '所属单位',
    keyName: 'projectId',
    rules: [{ required: true, message: '请选择所属单位', trigger: 'change' }],
    slot: true,
    span: 16,
  },
  {
    label: '所属月度',
    keyName: 'belongMonth',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '调整原因',
    keyName: 'adjustReason',
    type: 'a-select',
    rules: [{ required: true, message: '请选择调整原因', trigger: 'change' }],
    data: []
  },
  {
    label: '调整最高节点等级',
    keyName: 'adjustMaxLevel',
    type: 'BaseInput',
    disabled: true
  },
  {
    label: '情况说明',
    keyName: 'situationExplain',
    type: 'BaseTextarea',
    rules: [{ required: true, message: '请输入情况说明', trigger: 'change' }],
    attrs: {
      maxLength: 3000
    },
    span: 24
  }
]
// 预调整表头
const columns1 = [
  {
    title: '编号',
    width: 100,
    align: 'center',
    dataIndex: 'sortNum',
  },
  {
    title: '阶段/类别',
    width: 260,
    dataIndex: 'phaseCategory'
  },
  {
    title: '业务事项',
    width: 200,
    dataIndex: 'businessMatters'
  },
  {
    title: '管控级别',
    width: 120,
    dataIndex: 'controlLevelId'
  },
  {
    title: '周期(天)',
    width: 100,
    dataIndex: 'period'
  },
  {
    title: '计划开始时间',
    width: 150,
    dataIndex: 'planStartTime'
  },
  {
    title: '计划完成时间',
    width: 150,
    dataIndex: 'planEndTime'
  },
  {
    title: '实际完成时间',
    width: 120,
    dataIndex: 'completeTime'
  },
  // {
  //   title: '前置任务',
  //   width: 120,
  //   dataIndex: 'frontTask'
  // },
  // {
  //   title: '间隔时间',
  //   width: 120,
  //   dataIndex: 'intervalTime'
  // },
  {
    title: '完成标准',
    width: 200,
    dataIndex: 'completeStandard'
  },
  {
    title: '验证资料',
    width: 150,
    dataIndex: 'verifyFiles'
  },
  {
    title: '第一责任人',
    width: 200,
    ellipsis: true,
    dataIndex: 'firstResName'
  },
  {
    title: '直接责任人',
    width: 260,
    dataIndex: 'directResPerList'
  },
  {
    title: '节点状态',
    width: 120,
    dataIndex: 'nodeStatusName'
  },
  {
    title: '调整情况',
    width: 120,
    dataIndex: 'adjustCase'
  },
  // {
  //   title: '是否关键线路节点',
  //   width: 150,
  //   dataIndex: 'isKeyNode'
  // },
  // {
  //   title: '是否里程碑节点',
  //   width: 150,
  //   dataIndex: 'isMilestonesNode'
  // },
  // {
  //   title: '是否主要工序开始节点',
  //   width: 180,
  //   dataIndex: 'isMainProcessNode'
  // },
  // {
  //   title: '是否垂直运输设备装拆',
  //   width: 180,
  //   dataIndex: 'isVerticalTransportNode'
  // },
  // {
  //   title: '是否合同节点',
  //   width: 180,
  //   dataIndex: 'isContractDurationNode'
  // },
  // {
  //   title: '合同开始时间',
  //   width: 180,
  //   dataIndex: 'contractStartDate'
  // },
  // {
  //   title: '合同完成时间',
  //   width: 180,
  //   dataIndex: 'contractEndDate'
  // }
]
// 管控级别
const controlLevelList = [
  {
    value: '1',
    label: '一级节点'
  },
  {
    value: '2',
    label: '二级节点'
  },
  {
    value: '3',
    label: '三级节点'
  }
]
// 完成标准
const completeStandardList = ['验收照片及现场照片', '分包单位合同签订完成,具备进厂配合条件', '验收通过文件']
// 验证资料
const verifyFilesList = ['验收资料扫描件', '合同扫描件', '验收通过文件扫描件']
//
export {
  searchOption,
  columns,
  formOption,
  columns1,
  controlLevelList,
  completeStandardList,
  verifyFilesList
}
